package com.raining.inningz.adapter;

import java.util.ArrayList;
import java.util.List;

import com.raining.inningz.R;
import com.raining.inningz.database.dao.Matches;



import android.app.Activity;
import android.content.Context;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
public class MatchListAdapter extends ArrayAdapter<Matches> {

	Context context;


	public MatchListAdapter(Context context, List<Matches> objects) {
		super(context, 0, objects);

		this.context = context;

	   

	}
	
	



	@Override
	public View getView(final int position, View convertView, ViewGroup parent) {
		ViewHolder holder = null;
		final Matches rowItem = getItem(position);

		LayoutInflater mInflater = (LayoutInflater) context	.getSystemService(Activity.LAYOUT_INFLATER_SERVICE);
		if (convertView == null) {
			convertView = mInflater.inflate(R.layout.list_view_type1, null);
			holder = new ViewHolder();

			
		  
			holder.txtName = (TextView) convertView.findViewById(R.id.txtName);
			holder.txtName2 = (TextView) convertView.findViewById(R.id.txtName2);
			
			
			
		
			
			convertView.setTag(holder);
		} else
			holder = (ViewHolder) convertView.getTag();
		
		
	
		holder.txtName.setText(rowItem.getMatchId());
		
		holder.txtName2.setText(rowItem.getHomeTeamShortNm()  +" VS "+rowItem.getVisitorsShortNm());
		
		
		return convertView;
		
		
		
		
		
		
	}
protected Context getRatingBarChilli() {
		
		return null;
	}
private class ViewHolder {
	
		TextView txtName;
		TextView txtName2;
	}



}

	
